bitkeeper revision 1.298 (3f0abd1eIZ0uRBzOhjxHKMhL6Hmm2w)
authorsos22@labyrinth.cl.cam.ac.uk <sos22@labyrinth.cl.cam.ac.uk>
Tue, 8 Jul 2003 12:46:22 +0000 (12:46 +0000)
committersos22@labyrinth.cl.cam.ac.uk <sos22@labyrinth.cl.cam.ac.uk>
Tue, 8 Jul 2003 12:46:22 +0000 (12:46 +0000)
Whitespace fixes.

BitKeeper/etc/ignore
xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_physdisk_proc.c
xenolinux-2.4.21-sparse/fs/partitions/xeno.c

index d472726b7ae6bbd6f785d5a0125af4d2b89e7859..c0f477469ea17c2d0eb5310e2212c3b65d95ead7 100644 (file)
@@ -428,3 +428,6 @@ xenolinux-2.4.16-sparse/arch/xeno/drivers/block/block.c.orig
 xenolinux-2.4.16-sparse/scripts/kconfig.tk
 xenolinux-2.4.21-sparse/include/linux/blk.h~
 tools/control/.checkstyle
+xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_block.c~
+xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_physdisk_proc.c.bak
+xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_physdisk_proc.c~
index 1dd67653cbfecf21d9b8553b08aac3b02aa17915..dd8c20ac31cadf75dc353e0358fefc809f73bfa2 100644 (file)
@@ -15,105 +15,106 @@ extern unsigned short xldev_to_physdev(kdev_t xldev);
 
 static dev_t physdev_to_xldev(unsigned short physdev)
 {
-  switch (physdev & XENDEV_TYPE_MASK) {
-  case XENDEV_IDE:
-    switch (physdev & XENDEV_IDX_MASK) {
-    case 0 ... (XLIDE_DEVS_PER_MAJOR-1):
-      return MKDEV(XLIDE_MAJOR_0,
-                  (physdev & XENDEV_IDX_MASK) << XLIDE_PARTN_SHIFT);
-    case XLIDE_DEVS_PER_MAJOR ... (XLIDE_DEVS_PER_MAJOR * 2 - 1):
-      return MKDEV(XLIDE_MAJOR_1,
-                  (physdev & XENDEV_IDX_MASK) << XLIDE_PARTN_SHIFT);
+    switch (physdev & XENDEV_TYPE_MASK) {
+    case XENDEV_IDE:
+       switch (physdev & XENDEV_IDX_MASK) {
+       case 0...(XLIDE_DEVS_PER_MAJOR - 1):
+           return MKDEV(XLIDE_MAJOR_0,
+                        (physdev & XENDEV_IDX_MASK) << XLIDE_PARTN_SHIFT);
+       case XLIDE_DEVS_PER_MAJOR...(XLIDE_DEVS_PER_MAJOR * 2 - 1):
+           return MKDEV(XLIDE_MAJOR_1,
+                        (physdev & XENDEV_IDX_MASK) << XLIDE_PARTN_SHIFT);
+       }
+       break;
+    case XENDEV_SCSI:
+       return MKDEV(XLSCSI_MAJOR,
+                    (physdev & XENDEV_IDX_MASK) << XLSCSI_PARTN_SHIFT);
+    case XENDEV_VIRTUAL:
+       return MKDEV(XLVIRT_MAJOR,
+                    (physdev & XENDEV_IDX_MASK) << XLVIRT_PARTN_SHIFT);
     }
-    break;
-  case XENDEV_SCSI:
-    return MKDEV(XLSCSI_MAJOR,
-                (physdev & XENDEV_IDX_MASK) << XLSCSI_PARTN_SHIFT);
-  case XENDEV_VIRTUAL:
-    return MKDEV(XLVIRT_MAJOR,
-                (physdev & XENDEV_IDX_MASK) << XLVIRT_PARTN_SHIFT);
-  }
-  printk(KERN_ALERT "Unrecognised xl device: %x\n", physdev);
-  BUG();
-  return -1;
+    printk(KERN_ALERT "Unrecognised xl device: %x\n", physdev);
+    BUG();
+    return -1;
 }
 
-static ssize_t proc_read_phd(struct file * file, char * buff, size_t size,
+static ssize_t proc_read_phd(struct file *file, char *buff, size_t size,
                             loff_t * off)
 {
-  physdisk_probebuf_t *buf;
-  int res;
-  struct proc_dir_entry *pde;
-  int x;
-
-  if (size != sizeof(physdisk_probebuf_t))
-    return -EINVAL;
-
-  buf = kmalloc(sizeof(physdisk_probebuf_t), GFP_KERNEL);
-  if (!buf)
-    return -ENOMEM;
-
-  pde = file->f_dentry->d_inode->u.generic_ip;
-  buf->domain = (int)pde->data;
-
-  /* The offset reported by lseek and friends doesn't have to be in
-     bytes, and it's marginally easier to say that it's in records, so
-     that's what we do. */
-  buf->start_ind = *off;
-  res = xenolinux_control_msg(XEN_BLOCK_PHYSDEV_PROBE, (void *)buf,
-                             sizeof(physdisk_probebuf_t));
-  *off += buf->n_aces;
-
-  if (res)
-    res = -EINVAL;
-  else {
-    for (x = 0; x < buf->n_aces; x++)
-      buf->entries[x].device = physdev_to_xldev(buf->entries[x].device);
-    res = sizeof(physdisk_probebuf_t);
-    if (copy_to_user(buff, buf, sizeof(physdisk_probebuf_t))) {
-      res = -EFAULT;
+    physdisk_probebuf_t *buf;
+    int res;
+    struct proc_dir_entry *pde;
+    int x;
+
+    if (size != sizeof(physdisk_probebuf_t))
+       return -EINVAL;
+
+    buf = kmalloc(sizeof(physdisk_probebuf_t), GFP_KERNEL);
+    if (!buf)
+       return -ENOMEM;
+
+    pde = file->f_dentry->d_inode->u.generic_ip;
+    buf->domain = (int) pde->data;
+
+    /* The offset reported by lseek and friends doesn't have to be in
+       bytes, and it's marginally easier to say that it's in records, so
+       that's what we do. */
+    buf->start_ind = *off;
+    res = xenolinux_control_msg(XEN_BLOCK_PHYSDEV_PROBE, (void *) buf,
+                               sizeof(physdisk_probebuf_t));
+    *off += buf->n_aces;
+
+    if (res)
+       res = -EINVAL;
+    else {
+       for (x = 0; x < buf->n_aces; x++)
+           buf->entries[x].device =
+               physdev_to_xldev(buf->entries[x].device);
+       res = sizeof(physdisk_probebuf_t);
+       if (copy_to_user(buff, buf, sizeof(physdisk_probebuf_t))) {
+           res = -EFAULT;
+       }
     }
-  }
-  kfree(buf);
-  return res;
+    kfree(buf);
+    return res;
 }
 
 static int proc_write_phd(struct file *file, const char *buffer,
-                         size_t count, loff_t *ignore)
+                         size_t count, loff_t * ignore)
 {
-  char *local;
-  int res;
-  xp_disk_t *xpd;
-  struct proc_dir_entry *pde;
-
-  if (count != sizeof(xp_disk_t))
-    return -EINVAL;
-
-  local = kmalloc(count + 1, GFP_KERNEL);
-  if (!local)
-    return -ENOMEM;
-  if (copy_from_user(local, buffer, count)) {
-    res = -EFAULT;
-    goto out;
-  }
-
-  xpd = (xp_disk_t *)local;
-
-  pde = file->f_dentry->d_inode->u.generic_ip;
-  xpd->domain = (int)pde->data;
-  xpd->device = xldev_to_physdev(xpd->device);
-
-  res = xenolinux_control_msg(XEN_BLOCK_PHYSDEV_GRANT, local, count);
-  if (res == 0)
-    res = count;
-  else
-    res = -EINVAL;
- out:
-  kfree(local);
-  return res;
+    char *local;
+    int res;
+    xp_disk_t *xpd;
+    struct proc_dir_entry *pde;
+
+    if (count != sizeof(xp_disk_t))
+       return -EINVAL;
+
+    local = kmalloc(count + 1, GFP_KERNEL);
+    if (!local)
+       return -ENOMEM;
+    if (copy_from_user(local, buffer, count)) {
+       res = -EFAULT;
+       goto out;
+    }
+
+    xpd = (xp_disk_t *) local;
+
+    pde = file->f_dentry->d_inode->u.generic_ip;
+    xpd->domain = (int) pde->data;
+    xpd->device = xldev_to_physdev(xpd->device);
+
+    res = xenolinux_control_msg(XEN_BLOCK_PHYSDEV_GRANT, local, count);
+    if (res == 0)
+       res = count;
+    else
+       res = -EINVAL;
 out:
+    kfree(local);
+    return res;
 }
 
 struct file_operations dom0_phd_fops = {
-  read : proc_read_phd,
-  write : proc_write_phd
+  read:proc_read_phd,
+  write:proc_write_phd
 };
index 462b4a5c1bdc98ea7b7895269d9b2eaa1b57aa10..0496d96044499450bd82051dd900ebc81fb9baaa 100644 (file)
@@ -20,59 +20,58 @@ int xeno_partition(struct gendisk *hd,
                   unsigned long first_sec,
                   int first_part_minor)
 {
-  physdisk_probebuf_t *buf;
-  int i;
-  int minor;
-  int count;
+    physdisk_probebuf_t *buf;
+    int i;
+    int minor;
+    int count;
+    
+    buf = kmalloc(sizeof(*buf), GFP_KERNEL);
+    if (!buf)
+        return -ENOMEM;
+    buf->domain = start_info.dom_id;
+    buf->start_ind = 0;
+    buf->n_aces = PHYSDISK_MAX_ACES_PER_REQUEST;
 
-  buf = kmalloc(sizeof(*buf), GFP_KERNEL);
-  if (!buf)
-    return -ENOMEM;
-  buf->domain = start_info.dom_id;
-  buf->start_ind = 0;
-  buf->n_aces = PHYSDISK_MAX_ACES_PER_REQUEST;
-
-  xenolinux_control_msg(XEN_BLOCK_PHYSDEV_PROBE, (char *)buf,
-                       sizeof(*buf));
-  if (buf->n_aces == 0) {
-    kfree(buf);
-    return 0;
-  }
+    xenolinux_control_msg(XEN_BLOCK_PHYSDEV_PROBE, (char *)buf,
+                         sizeof(*buf));
+    if (buf->n_aces == 0) {
+        kfree(buf);
+       return 0;
+    }
 
-  if (buf->n_aces == PHYSDISK_MAX_ACES_PER_REQUEST) {
-    kfree(buf);
-    return 0;
-  }
+    if (buf->n_aces == PHYSDISK_MAX_ACES_PER_REQUEST) {
+        kfree(buf);
+       return 0;
+    }
 
-  count = 0;
+    count = 0;
 
-  for (i = 0; i < buf->n_aces; i++) {
-    if (buf->entries[i].partition == 0) {
-      continue;
-    }
-    /* Make sure the partition is actually supposed to be on this
-       disk.  This assumes that Xen and XenoLinux block device
-       numbers match up. */
-    if (buf->entries[i].device != xldev_to_physdev(bdev->bd_dev)) {
-      continue;
-    }
-    /* This is a bit of a hack - the partition numbers are specified
-       by the hypervisor, and if we want them to match up, this is
-       what we need to do. */
-    count ++;
-    minor = buf->entries[i].partition + first_part_minor - 1;
-    add_gd_partition(hd,
-                    minor,
-                    buf->entries[i].start_sect,
-                    buf->entries[i].n_sectors);
-  }  
-  kfree(buf);
+    for (i = 0; i < buf->n_aces; i++) {
+        if (buf->entries[i].partition == 0) {
+           continue;
+       }
+       /* Make sure the partition is actually supposed to be on this
+          disk. */
+       if (buf->entries[i].device != xldev_to_physdev(bdev->bd_dev)) {
+           continue;
+       }
+       /* This is a bit of a hack - the partition numbers are
+          specified by the hypervisor, and if we want them to match
+          up, this is what we need to do. */
+       count ++;
+       minor = buf->entries[i].partition + first_part_minor - 1;
+       add_gd_partition(hd,
+                        minor,
+                        buf->entries[i].start_sect,
+                        buf->entries[i].n_sectors);
+    }  
+    kfree(buf);
 
-  /* If we didn't find any suitable Xeno partitions, try the other
-     types. */
-  if (!count)
-    return 0;
+    /* If we didn't find any suitable Xeno partitions, try the other
+       types. */
+    if (!count)
+        return 0;
 
-  printk("\n");
-  return 1;
+    printk("\n");
+    return 1;
 }